import fetch from 'common/src/utils/fetch'
//查询导师列表信息
export function findTeacherList(data) {
    return fetch({
        url: '/api/welcomeservice/teacher/findTeacherList',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}

//查询某导师可以申请的学生列表信息
export function findApplyStudentList(data) {
    return fetch({
        url: '/api/welcomeservice/teacher/findApplyStudentList',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}
//管理员给导师指定学生接口
export function saveStudentTeacherMap(teacherId, studentId) {
    return fetch({
        url: '/api/welcomeservice/teacher/saveStudentTeacherMap',
        method: 'post',
        headers: { 'Content-Type': 'application/text' },
        data: {
            teacherId: teacherId,
            studentId: studentId
        }
    })
}

//查询学生关联导师列表信息
export function findAllStudentList(data) {
    return fetch({
        url: '/api/welcomeservice/teacher/findAllStudentList',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}
//查询某学生可以申请的导师列表信息
export function findApplyTeacherList(data) {
    return fetch({
        url: '/api/welcomeservice/teacher/findApplyTeacherList',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}

//（新增）学生申请导师
export function addStudentTeacherMap(data) {
    return fetch({
        url: '/api/welcomeservice/teacher/addStudentTeacherMap',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}

//查询导师基本信息

export function findTeacherById(teacherId) {
    return fetch({
        url: '/api/welcomeservice/teacher/findTeacherById?teacherId=' + teacherId,
        method: 'get'
    })
}

//导出导师列表
export function exportTeacherApplyList(params) {
    let url = '/api/welcomeservice/teacher/exportTeacherList';
    let query = '?';
    for (let key in params) {
        query += key;
        query += '=';
        query += params[key];
        query += '&'
    }
    return url + query;
}
//导出学生导师管理列表
export function exportStudentList(params) {
    let url = '/api/welcomeservice/teacher/exportStudentList';
    let query = '?';
    for (let key in params) {
        query += key;
        query += '=';
        query += params[key];
        query += '&'
    }
    return url + query;
}
//给导师自动分配学生
export function batchStudentTeacherMap(data) {
    return fetch({
        url: '/api/welcomeservice/teacher/batchStudentTeacherMap',
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}
//变更导师
export function updateStudentTeacherMap(data) {
    return fetch({
        url: '/api/welcomeservice/teacher/updateStudentTeacherMap',
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}

//发布申请
export function updateApplyStatus(data) {
    return fetch({
        url: '/api/welcomeservice/teacher/updateApplyStatus',
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}

export function getImageData(faceUrl) {
    return fetch({
        url: '/api/commonservice/obsfile/downloadimage?objectkey=' + faceUrl,
        method: 'GET'
    })
}

// 本科生获取院校下拉框
export function universities(data) {
    return fetch({
        url: '/api/externalexchangeservice/ug/university/appoint/universities',
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}

// 研究生获取学院下拉框
export function getCollegeListByNationCode(data) {
    return fetch({
        url: '/api/externalexchangeservice/overseasCollege/getCollegeListByNationCode',
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}